<?php

namespace Proxy;

include_once "SubjectInterface.php";

/** 代理模式---真实的实体类 */
class RealSubject implements SubjectInterface
{
    private string $fileName;

    public function __construct($params)
    {
        $this->fileName = $params;
        $this->loadFromDisk();
    }

    /**
     * 真实实体请求
     * @return void
     */
    public function request()
    {
        echo "代理模式---我是真实的请求：{$this->fileName}" . PHP_EOL;
    }

    public function loadFromDisk()
    {
        echo "代理模式---我从磁盘加载的：{$this->fileName}" . PHP_EOL;
    }
}